<html xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="category_tree">
    <div id="category_tree">
        <div class="tit">所有商品分类</div>
        <dl class="clearfix" style=" overflow:hidden;">
            <div class="box1 cate" id="cate">
                
                <div th:each="item :${categoriesList}">
                    <h1 onclick="tab(0)" style="border-top:none">
                        <span class="f_l"><img src="/static/images/btn_unfold.gif" style="padding-top:10px;padding-right:6px;cursor:pointer;"></span>
                    </h1>
                    <a style="border-top:none" th:href="${item.url}" class="  f_ll" th:text="${item.name}"></a>
                    <ul style="display: block;">
                    </ul>
                    <div style="clear:both"></div>
                </div>
                 
            </div>
            <div style="clear:both"></div>
    </div>
    <div class="blank"></div>
    <script type="text/javascript">
        obj_h4 = document.getElementById("cate").getElementsByTagName("h4")
        obj_ul = document.getElementById("cate").getElementsByTagName("ul")
        obj_img = document.getElementById("cate").getElementsByTagName("img")

        function tab(id) {
            if (obj_ul.item(id).style.display == "block") {
                obj_ul.item(id).style.display = "none"
                obj_img.item(id).src = "/static/images/btn_fold.gif"
                return false;
            } else if(obj_ul.item(id).style.display == "none") {
                obj_ul.item(id).style.display = "block"
                obj_img.item(id).src = "/static/images/btn_unfold.gif"
            }
        }
    </script>
</th:block>

</html>